<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/style/admin.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div id="layer-details" class="layui-collapse">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script id="maintain-plan-detail-tpl" type="text/html">
    {{# layui.each(d, function(index, item){ }}
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">{{item.item}}</h2>
        <div class="layui-colla-content layui-show">
            <ul class="layui-timeline">
                {{# layui.each(item.entries, function(index, entry){ }}
                <li class="layui-timeline-item">
                    <i class="layui-icon layui-timeline-axis">&#x1005;</i>
                    <div class="layui-timeline-content layui-text">
                        <p>{{entry}}</p>
                    </div>
                </li>
                {{# }); }}
            </ul>
        </div>
    </div>
    {{# }); }}
    {{# if(d.length === 0){ }}
    暂无数据
    {{# } }}
</script>
<script src="/layui/layui.js"></script>
<script src="/js/common.js"></script>

<script>
    layui.config({
        base: '/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'laytpl', 'util'], function () {
        var $ = layui.$;
        var laytpl = layui.laytpl;
        layui.util.fixbar();
        var id = getParam('id');

        loadDetail(id);

        function loadDetail(id) {
            $.get('maintain-plans/' + id + '/detail', function (res) {
                var tpl = $('#maintain-plan-detail-tpl').html();
                laytpl(tpl).render(res.data, function (html) {
                    $('#layer-details').html(html);
                });
            });

        }

    });
</script>
</body>
</html>